package com.techsoul.module.tms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.basic.pojo.param.SuspiciousItemSaveParam;
import com.techsoul.module.order.pojo.entity.PurchaseOrderItem;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDelivery;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDeliveryLine;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialReceipt;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialReceiptLine;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialReceiptLineSaveParam;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialReceiptVo;
import com.techsoul.module.tms.pojo.entity.TFoFreightOrder;
import com.techsoul.module.tms.pojo.entity.TFoFreightOrderItem;
import com.techsoul.module.tms.pojo.param.TFoFreightOrderItemSaveParam;
import com.techsoul.module.tms.pojo.param.TFoFreightOrderItemSearchParam;
import com.techsoul.module.tms.pojo.vo.DispatchImportOrderItemVo;
import com.techsoul.module.tms.pojo.vo.TFoFreightOrderItemVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 运单明细 Service接口
 * 
 * @author liuen
 * @date 2023-05-29
 */
public interface ITFoFreightOrderItemService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(TFoFreightOrderItemSaveParam params);
    String moveToSuspicious(TFoFreightOrderItemSaveParam params);
    String resolveSuspicious(SuspiciousItemSaveParam param);
    String confirm(String id);



    List<TFoFreightOrderItem> generateMoveTrDispatch
            (List<TbWmsMaterialReceipt> deliverys, List<TbWmsMaterialReceiptLine> items,
             TFoFreightOrderItemSaveParam params, UserVo user, List<TFoFreightOrder> orders, String moveToWarehouse, List<Map<String,String>> tbWmsMaterialReceiptsMap);
    List<TFoFreightOrderItem> generateMoveDispatch
            (List<TbWmsMaterialDelivery> deliverys,List<TbWmsMaterialDeliveryLine> items,
             TFoFreightOrderItemSaveParam params, UserVo user, List<TFoFreightOrder> orders,String moveToWarehouse);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(TFoFreightOrderItemSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    TFoFreightOrderItemVo findById(String id);


    /**
     * 列表
     * @param params
     * @return
     */
    List<TFoFreightOrderItemVo> findAll(TFoFreightOrderItemSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<TFoFreightOrderItemVo> findAll(TFoFreightOrderItemSearchParam params, Integer current, Integer pageSize);

    String importData1(MultipartFile file);
    String importDataWithCarrier(MultipartFile file);

    String saveToDelivery(DispatchImportOrderItemVo data, UserVo user, TbWmsMaterialReceiptVo receiptVo);
    void saveToExceptions(DispatchImportOrderItemVo data, PurchaseOrderItem ent, UserVo sysUser);

    void updateToDelivery(UserVo sysUser,TbWmsMaterialReceiptVo receiptVo, TbWmsMaterialDeliveryLine line);
}
